const mongoose = require('mongoose')
const baseConfig = require('../config/config.default')

const main = async () => {
    mongoose.connect(baseConfig.dbUrl)
}

main()
    .then(res => {
        console.log('数据库连接成功')
    })
    .catch(err => {
        console.log(err)
        console.log('数据库连接失败')
    })

module.exports = {
    User: mongoose.model('User', require('./userModel'))
}
